package com.weai.portal.repository;

import com.weai.portal.entity.AiList;
import com.weai.portal.entity.TaskReport;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import java.time.LocalDate;
import java.util.List;

/**
 * AI清单数据访问层
 */
@Repository
public interface TaskReportRepository extends JpaRepository<TaskReport, Integer> {
    

    @Query("select t from TaskReport t where t.periodStartDate = :startDate and t.periodEndDate = :endDate")
    List<TaskReport> findAll(LocalDate startDate, LocalDate endDate);

    @Modifying
    @Query("delete from TaskReport t where  t.periodStartDate = :startDate  and t.periodEndDate = :endDate")
    void deleteByDate(LocalDate startDate, LocalDate endDate);
} 